<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CRUD</title>
  <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="/public/css/style.css">
</head>
<body>
  <div class="container">
    <div class="header">
      <h3>Students Management System</h3>
    </div>
    <div class="add">
      <a href="/students/new" class="btn btn-success">添加学生</a>
    </div>
    <div class="student_list">
      <table class="table table-striped">
        <thead>
          <tr>
            <th>序号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>兴趣</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          {{ each students }}
          <tr>
            <td scope="row">{{$value.id}}</td>
            <td>{{$value.name}}</td>
            <td>{{$value.sex}}</td>
            <td>{{$value.age}}</td>
            <td>{{$value.hobby}}</td>
            <td>
              <a href="/students/delete?id={{ $value._id }}" class="btn btn-danger">删除</a>
              <a href="/students/edit?id={{ $value._id }}" class="btn btn-primary">编辑</a>
            </td>
          </tr>
          {{ /each }}
        </tbody>
      </table>
    </div>
  </div>
</body>
</html>